<template>
    <view class="container-ccc data-v-11f5f41f">
        <canvas
            canvasId="default_PosterCanvasId"
            class="hideCanvas data-v-11f5f41f"
            :style="'width:' + (poster.width || 0) + 'px' + ';' + 'height:' + (poster.height || 0) + 'px' + ';'"
        ></canvas>
        <image class="poster data-v-11f5f41f" mode="widthFix" :src="posterPath" v-if="posterPath"></image>
        <view class="empty-block data-v-11f5f41f" v-else></view>
    </view>
</template>

<script>
import tabBar from '@/components/TabBar/tabBar';
(global.webpackJsonp = global.webpackJsonp || []).push([
    ['components/SharePopup/components/posterTheme1'],
    {
        '04ac': function (e, t, n) {
            'use strict';

            n.r(t);
            var o = n('1818');
            var r = n('756e');
            for (var a in r) {
                if (['default'].indexOf(a) < 0) {
                    (function (e) {
                        n.d(t, e, function () {
                            return r[e];
                        });
                    })(a);
                }
            }
            n('23a3');
            var i = n('f0c5');
            var c = Object(i.a)(r.default, o.b, o.c, false, null, '11f5f41f', null, false, o.a, void 0);
            t.default = c.exports;
        },
        1818: function (e, t, n) {
            'use strict';

            n.d(t, 'b', function () {
                return o;
            });
            n.d(t, 'c', function () {
                return r;
            });
            n.d(t, 'a', function () {});
            var o = function () {
                this.$createElement;
                this._self._c;
            };
            var r = [];
        },
        '23a3': function (e, t, n) {
            'use strict';

            var o = n('be30');
            n.n(o).a;
        },
        '756e': function (e, t, n) {
            'use strict';

            n.r(t);
            var o = n('78d9');
            var r = n.n(o);
            for (var a in o) {
                if (['default'].indexOf(a) < 0) {
                    (function (e) {
                        n.d(t, e, function () {
                            return o[e];
                        });
                    })(a);
                }
            }
            t.default = r.a;
        },
        '78d9': function (e, t, n) {
            'use strict';

            var o = n('4ea4');
            Object.defineProperty(t, '__esModule', {
                value: true
            });
            t.default = void 0;
            var r = o(n('2eee'));
            var a = o(n('c973'));
            var i = o(n('b5e5'));
            var c = n('955d');
            var s = {
                data: function () {
                    return {
                        canvasId: 'default_PosterCanvasId',
                        poster: null,
                        posterPath: null
                    };
                },
                components: {},
                computed: {
                    displayPrice: function () {
                        var e = '';
                        if (this.info && this.info.money_price) {
                            e = this.info.money_price / 100 + '元';
                        }
                        if (this.info && this.info.score_price) {
                            e += (e ? '+' : '') + this.info.score_price + this.scoreAlias;
                        }
                        e || (e = '');
                        return e;
                    }
                },
                props: {
                    info: {
                        type: Object,
                        default: function () {
                            return {};
                        }
                    }
                },
                watch: {
                    info: function () {
                        this.generatePoster();
                    }
                },
                mounted: function () {
                    this.generatePoster();
                },
                methods: {
                    generatePoster: function () {
                        var that = this;
                        return (0, a.default)(
                            r.default.mark(function t() {
                                var n;
                                return r.default.wrap(
                                    function (t) {
                                        for (;;) {
                                            switch ((t.prev = t.next)) {
                                                case 0:
                                                    t.prev = 0;
                                                    t.next = 3;
                                                    return (0, c.getSharePoster)({
                                                        _this: that,
                                                        type: 'testShareType',
                                                        posterCanvasId: that.canvasId,
                                                        delayTimeScale: 20,
                                                        background: {
                                                            height: 1000,
                                                            width: 696,
                                                            backgroundColor: '#ffffff'
                                                        },
                                                        drawArray: function (t) {
                                                            var n = t.bgObj;
                                                            t.type;
                                                            t.bgScale;
                                                            n.width;
                                                            n.width;
                                                            n.height;
                                                            return new Promise(function (t, o) {
                                                                t([
                                                                    {
                                                                        type: 'image',
                                                                        url: that.info.thumb,
                                                                        dx: 0,
                                                                        dy: 0,
                                                                        infoCallBack: function (e) {
                                                                            return {
                                                                                dWidth: n.width,
                                                                                dHeight: n.width + 225,
                                                                                mode: 'aspectFit'
                                                                            };
                                                                        }
                                                                    },
                                                                    {
                                                                        type: 'image',
                                                                        url: that.info.qrcode,
                                                                        dx: 180,
                                                                        dy: n.width - 95,
                                                                        infoCallBack: function (e) {
                                                                            n.width;
                                                                            e.height;
                                                                            return {
                                                                                dWidth: 156,
                                                                                dHeight: 130,
                                                                                roundRectSet: {
                                                                                    r: 70
                                                                                }
                                                                            };
                                                                        }
                                                                    }
                                                                ]);
                                                            });
                                                        },
                                                        setCanvasWH: function (t) {
                                                            var n = t.bgObj;
                                                            t.type;
                                                            t.bgScale;
                                                            that.poster = n;
                                                        }
                                                    });
                                                case 3:
                                                    n = t.sent;
                                                    that.poster.finalPath = n.poster.tempFilePath;
                                                    that.posterPath = n.poster.tempFilePath;
                                                    that.$emit('getPosterUrl', that.posterPath);
                                                    t.next = 13;
                                                    break;
                                                case 9:
                                                    t.prev = 9;
                                                    t.t0 = t.catch(0);
                                                    i.default.hideLoading();
                                                    i.default.showToast(JSON.stringify(t.t0));
                                                case 13:
                                                case 'end':
                                                    return t.stop();
                                            }
                                        }
                                    },
                                    t,
                                    null,
                                    [[0, 9]]
                                );
                            })
                        )();
                    }
                }
            };
            t.default = s;
        },
        be30: function (e, t, n) {}
    }
]);
(global.webpackJsonp = global.webpackJsonp || []).push([
    'components/SharePopup/components/posterTheme1-create-component',
    {
        'components/SharePopup/components/posterTheme1-create-component': function (e, t, n) {
            n('543d').createComponent(n('04ac'));
        }
    },
    [['components/SharePopup/components/posterTheme1-create-component']]
]);
</script>
<style>
@import './posterTheme1.css';
</style>
